====================================================================
=== Tetris: The Grand Master ZN-2 to PSX conversion Music Add-on ===
====================================================================

The cdda_music.ips patch adds support for playing CD-DA music.

The music will need to be converted from VGM to WAV by using a tool such as VGMPlay's vgm2wav.  A convert_tgm_music.sh script has been included which will do this for you, provided you have vgm2wav available.

In order to keep compatibility with running the game on an unmodified PlayStation console via a boot disc such as an Action Replay or GameShark, the music playback code does NOT rely on the disc TOC for the track information and instead the track positions are hard-coded.  It is therefore important that you adhere to the lengths and constraints mentioned below.

Note that to prevent the music from being interrupted during playback, the loading of different background graphics on section change has been disabled.


Requirements:
- vgmplay-0.40.9 (in particular vgm2wav), available from: https://github.com/vgmrips/vgmplay/releases/tag/0.40.9
- Tetris The Grand Master music in VGM/VGZ format, available from: https://vgmrips.net/packs/pack/tetris-the-grand-master-zn-2
- mkpsxiso (v1.23), available from: https://github.com/Lameguy64/mkpsxiso


Instructions:
- Download the vgmplay-0.40.9 release and compile vgm2wav
- Extract the ZIP file that contains the VGM music (*.vgz)
- run the convert_tgm_music.sh script to create the WAV music tracks (track*.wav)
- compare the sizes of the created WAV files with the reference below:
    track02.wav:   1051804 bytes
    track03.wav: 237940428 bytes
    track04.wav: 197871808 bytes
    track05.wav:  22981080 bytes
    track06.wav:    535284 bytes
    track07.wav:   7449120 bytes
    track08.wav:    545532 bytes
    track09.wav: 222798688 bytes
    track10.wav:   2258756 bytes

- ensure you have applied the IPS patches to main.bin (including cdda_music.ips)
- follow the remaining steps described in the main readme to create the PSX-EXE and create the disc image using "mkpsxiso TGM_PSX_CDDA.xml"

The output of mkpsxiso should say:

ISO image generated successfully.
Total image size: 699099072 bytes (297236 sectors)

and the TGM_PSX_CDDA.cue file should look like this:

FILE "TGM_PSX_CDDA.bin" BINARY
  TRACK 01 MODE2/2352
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    PREGAP 00:02:00
    INDEX 01 00:16:04
  TRACK 03 AUDIO
    INDEX 00 00:22:02
    INDEX 01 00:24:02
  TRACK 04 AUDIO
    INDEX 00 22:52:68
    INDEX 01 22:54:68
  TRACK 05 AUDIO
    INDEX 00 41:36:48
    INDEX 01 41:38:48
  TRACK 06 AUDIO
    INDEX 00 43:48:69
    INDEX 01 43:50:69
  TRACK 07 AUDIO
    INDEX 00 43:53:72
    INDEX 01 43:55:72
  TRACK 08 AUDIO
    INDEX 00 44:38:15
    INDEX 01 44:40:15
  TRACK 09 AUDIO
    INDEX 00 44:43:22
    INDEX 01 44:45:22
  TRACK 10 AUDIO
    INDEX 00 65:48:25
    INDEX 01 65:50:25

